
package br.unifor.cct.mia.evolutionary;

import br.unifor.cct.mia.util.Configurations;

public class CobwebGenotype extends Genotype {

	private int numMerge;
	private int numSplit;
	private int numCluster;
	
	public CobwebGenotype(Configurations c) {
		super(c);		
	}
	
	public String toString(){
		String genes = "";
		
		for(int i = 0; i < configurations.getNvars(); i++) 
			genes += gene[i]+"  ";
		
		return  "fitness = "+fitness+"\n" +
				"probabilty = "+selectProbability+"\n"+
				"genes = "+genes+"\n"+
				"clusters = "+numCluster+"\n"+
				"merges = "+numMerge+"\n"+
				"splits = "+numSplit+"\n";
	}

	public Object clone() {	
		CobwebGenotype result = new CobwebGenotype(configurations);
		result.setFitness(this.getFitness());
		result.setSelectProbability(this.getSelectProbability());
		result.setLower(this.getLower());
		result.setUpper(this.getUpper());
		result.setNumCluster(this.getNumCluster());
		result.setNumMerge(this.getNumMerge());
		result.setNumSplit(this.getNumSplit());
	    System.arraycopy(this.getGene(),0,result.getGene(),0,this.getGene().length);
	    System.arraycopy(this.getInteger(),0,result.getInteger(),0,this.getInteger().length);
		return result;
	}
	
	public int getNumCluster() {
		return numCluster;
	}

	public void setNumCluster(int numCluster) {
		this.numCluster = numCluster;
	}

	public int getNumMerge() {
		return numMerge;
	}

	public void setNumMerge(int numMerge) {
		this.numMerge = numMerge;
	}

	public int getNumSplit() {
		return numSplit;
	}

	public void setNumSplit(int numSplit) {
		this.numSplit = numSplit;
	}
}
